package com.xiaochong.tir.trades.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2018/6/16.
 */
@Configuration
@Component
public class GateioQueenConfig {
    @Bean
    public DirectExchange GateioNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueTradesGateioUsdtAction(){
        return new Queue(GateioMqQueue.QUEUE_TRADES_GATEIO_USDT, true);
    }
    @Bean
    public Binding bindingTradesGateioUsdtAction(){
        return BindingBuilder.bind(queueTradesGateioUsdtAction()).to(GateioNodeAPIExchange()).with(GateioMqQueue.QUEUE_TRADES_GATEIO_USDT);
    }

    @Bean
    public Queue queueTradesGateioBtcAction(){
        return new Queue(GateioMqQueue.QUEUE_TRADES_GATEIO_BTC, true);
    }
    @Bean
    public Binding bindingTradesGateioBtcAction(){
        return BindingBuilder.bind(queueTradesGateioBtcAction()).to(GateioNodeAPIExchange()).with(GateioMqQueue.QUEUE_TRADES_GATEIO_BTC);
    }

    @Bean
    public Queue queueTradesGateioEthAction(){
        return new Queue(GateioMqQueue.QUEUE_TRADES_GATEIO_ETH, true);
    }
    @Bean
    public Binding bindingTradesGateioEthAction(){
        return BindingBuilder.bind(queueTradesGateioEthAction()).to(GateioNodeAPIExchange()).with(GateioMqQueue.QUEUE_TRADES_GATEIO_ETH);
    }

    @Bean
    public Queue queueTradesGateioSnetAction(){
        return new Queue(GateioMqQueue.QUEUE_TRADES_GATEIO_SNET, true);
    }
    @Bean
    public Binding bindingTradesGateioSnetAction(){
        return BindingBuilder.bind(queueTradesGateioSnetAction()).to(GateioNodeAPIExchange()).with(GateioMqQueue.QUEUE_TRADES_GATEIO_SNET);
    }

    @Bean
    public Queue queueTradesGateioQtumAction(){
        return new Queue(GateioMqQueue.QUEUE_TRADES_GATEIO_QTUM, true);
    }
    @Bean
    public Binding bindingTradesGateioQtumAction(){
        return BindingBuilder.bind(queueTradesGateioQtumAction()).to(GateioNodeAPIExchange()).with(GateioMqQueue.QUEUE_TRADES_GATEIO_QTUM);
    }
}
